home *** CD-ROM | disk | FTP | other *** search
/ PC Player 2004 May / pc player 2004-05.iso / Demos / FarCry / Data1.cab / _4C821EAAAC674FFE8E5F7D90D485C498 < prev    next >
Encoding:
Text File  |  2004-01-06  |  861 b   |  31 lines

  1. --------------------------------------------------
  2. --   Created By: petar
  3. --   Description: this is used to run to help a mate who called for help
  4. --------------------------
  5.  
  6. AIBehaviour.HoldPosition = {
  7.     Name = "HoldPosition",
  8.     NOPREVIOUS = 1,
  9.     
  10.     ---------------------------------------------
  11.     OnThreateningSoundHeard = function( self, entity, fDistance )
  12.  
  13.  
  14.         local dist = AI:FindObjectOfType(entity:GetPos(),fDistance,AIAnchor.HOLD_THIS_POSITION);
  15.         if (dist==nil) then
  16.             AI:Signal(0,1,"THREAT_TOO_CLOSE",entity.id);                
  17.         end
  18.     end,
  19.  
  20.     ---------------------------------------------
  21.     OnInterestingSoundHeard = function( self, entity, fDistance )
  22.  
  23.  
  24.         local dist = AI:FindObjectOfType(entity:GetPos(),fDistance,AIAnchor.HOLD_THIS_POSITION);
  25.         if (dist==nil) then
  26.             AI:Signal(0,1,"THREAT_TOO_CLOSE",entity.id);                
  27.         end
  28.     end,
  29.     
  30.     
  31. }